clear all ; close all; clc
x = [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
km = 1:length(x);
for k = km
if k > 1
y(k) = 0.7*y(k-1) + 0.3*x(k);
else
y(k) = 0.3*x(k);
end
end
figure(1); stem(km, y)
a = [1 -0.7]; b = [0.3];
h = impz(b, a, 15);
figure(1); stem(h);
xlabel('k'); ylabel('h_k'); 
grid on